<?
require_once 'config.php';
   $HomePage = false;
   $productsDownloadPage = true;
   $products = Products();
?>
<!DOCTYPE html>
<html lang="en">
<head>	
	<title>Download</title>
	<meta name="google-site-verification" content="gkB9RQiF61Fg779oj1do-N0_IcXutfYartJIAF7Dbtw" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta property="og:image" content=""/>
   <meta name="description" content="" />
   <meta name="keywords" content="" />
	<link type="image/x-icon" href="/favicon_home.ico" rel="icon" />
	<link rel="SHORTCUT ICON" href="/favicon_home.ico"/>   
   <link rel="stylesheet" type="text/css" href="../themes/css/base.css"/>
   <link rel="stylesheet" type="text/css" href="../themes/css/home.css"/>
   <link rel="stylesheet" type="text/css" href="../themes/css/detail.css"/>
   <link rel="stylesheet" type="text/css" href="../themes/css/product_download.css"/>
   <script type="text/javascript" src="../themes/js/jquery.js"></script>
    <?=$analytics?>

</head>
<body>
   <div class="globalContainer">
      <?
         include('view/common/vic_header.php');
      ?>
      <div class="line"></div>
      <div class="content">
         <div class="nav_wrap">
            <div class="nav_inner w1130">
               <ul class="nav">
                  <?
                     $i = 0;
                     foreach($products as $row){
                        $i++;
                  ?>
                        <li class="nav_products <?=($i == 1) ? 'nav_introduction nav_active_default' : ''?>"><a href="#pro<?=$i?>"><?=$row['pro_name']?></a></li>
                  <?
                     }
                  ?>
               </ul>
            </div>
         </div>
         <?
            $i = 0;
            foreach($products as $row){
               $i++;
         ?>
            <div class="soft_introduction_wrap <?=$i?>" >
               <div class="soft_introduction w1130" id="pro<?=$i?>">
                  <a href="<?=generate_product_detail_url($row)?>"><img src="<?=PATH_PICTURE_PRODUCT.$row['pro_image_detail']?>"/></a>
                  <div class="soft_inf">
                     <a href="<?=generate_product_detail_url($row)?>"><p class="soft_name1"><?=$row['pro_name']?></p></a>
                     <p class="soft_tit"><?=$row['pro_title']?></p>
                     <p class="soft_des"><?=$row['pro_description']?></p>
                     <a href="#" class="detail_view"><span>Xem thêm xem tính năng của Mass Forum Poster</span> <span class="arrow_detail_view"></span></a>
                  </div>
                  <div class="soft_more_inf">
                     <p class="down_buy_big"><a href="<?=$row['pro_download_link']?>" target="_blank">DOWNLOAD</a> | <a href="<?=generate_product_detail_url($row)?>#product_register_wrap">MUA</a></p>
                     <p class="soft_price"><?=format_price_fontend(($row['pro_promotion'] == 1) ? $row['pro_price_year_promotion'] : $row['pro_price_year'])?> VNĐ / NĂM</p>
                     <p class="soft_price"><?=format_price_fontend(($row['pro_promotion'] == 1) ? $row['pro_price_lifetime_promotion'] : $row['pro_price_lifetime'])?> VNĐ / TRỌN ĐỜI</p>
                     <p class="try_big">DÙNG THỬ MIỄN PHÍ</p>
                     <p class="inf_one">. Hướng dẫn cài đặt, sử dụng</p>
                     <p class="inf_one">. Đơn giản, dễ sử dụng.</p>
                     <p class="inf_one">. Hỗ trợ nhanh chóng, thuận tiện.</p>
                  </div>
               </div>
            </div>
            <div class="line1"></div>
         <?
            }
         ?>
      </div>
      <?
         include('view/common/vic_footer.php');
      ?>
   </div>
</body>
</html>
<script>
$(document).ready(function(){
   var lastId,
   nav = $(".nav"),
   navHeight = nav.outerHeight(),
   menuItems = nav.find("a"),
   scrollItems = menuItems.map(function(){
      var item = $($(this).attr("href"));
      if (item.length) { return item; }
   });
   
   menuItems.click(function(e){
      var href = $(this).attr("href"),
      offsetTop = href === "#" ? 0 : $(href).offset().top-navHeight+1;
      $('html, body').stop().animate({ 
            scrollTop: offsetTop
         }, 300);
         e.preventDefault();
   });
   $(window).scroll(function(){
      var fromTop = $(this).scrollTop()+navHeight;
      if(fromTop < 131){
         $('.nav_wrap').removeClass('fix');
         $('.1').css('margin-top', 0);	
         $('.nav_introduction').addClass('nav_active_default')
      }else{ 
         $('.nav_wrap').addClass('fix');
               $('.nav_wrap').css({'top':'0'});
               $('.1').css('margin-top', 45);	
         $('.nav_introduction').removeClass('nav_active_default')}
      
      // lấy id scroll item hiện tại
      var cur = scrollItems.map(function(){
        if ($(this).offset().top < fromTop)
          return this;
      });
      // lấy id phần tử hiện tại
      cur = cur[cur.length-1];
      var id = cur && cur.length ? cur[0].id : "";
      
      if (lastId !== id) {
          lastId = id;
          // add và remove active class
          menuItems
            .parent().removeClass("nav_active")
            .end().filter("[href=#"+id+"]").parent().addClass("nav_active");
      }                   
      });   
})
</script>